<!-- src/components/UserInfo.vue -->
<template>
  <div class="user-info">
    <p>欢迎，{{ user.username }}</p>
    <button @click="$emit('logout')">退出登录</button>
  </div>
</template>

<script setup>
defineProps({ user: Object })
</script>

<style scoped>
.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
</style>
